import java.util.ArrayList;
import java.util.List;

/**
 * @program: LeetCode
 * @description: LeetCode : 2549. 统计桌面上的不同数字
 * @author: WXY
 * @create: 2023-01-30 11:48
 * @Version 1.0
 **/
public class Num2549_distinctIntegers {
    public static int distinctIntegers(int n) {
        List<Integer> list = new ArrayList<>();
        list.add(n);
        int ans = 1;
        for (int i = 0; i < list.size(); i++) {
            for (int j = 2; j < list.get(i); j++) {
                if (list.get(i) % j == 1) {
                    if (!list.contains(j)) {
                        list.add(j);
                    }
                }
            }
        }
        return list.size();
    }

    public static void main(String[] args) {
        int n = 3;
        int count = distinctIntegers(n);
        System.out.println(count);
    }
}
